#include "LogAcceptor.h"

LogAcceptor::LogAcceptor(InetAddress &addr, Reactor * reactor)
  : acceptor_(addr), reactor_(reactor)
{
  reactor->registerHandler(this, ACCEPT_EVENT);
}

void LogAcceptor::handleEvent (Handle h, EventType et)
{
  if (et == ACCEPT_EVENT)
    {
      SocketStream * clientConnection = new SocketStream();
      acceptor_.accept(*clientConnection);

      LogHandler * ah = new LogHandler(clientConnection, reactor_);
    }
}

Handle LogAcceptor::getHandle() const
{
  return acceptor_.getHandle();
} 
